<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<x:parse xml="${param.xmlstr}" var="xmlData" />
<c:set var="grant_code">
	<x:out select="$xmlData/data/proposal/grant_code" />
</c:set>
<c:set var="sub_grant_code">
	<x:out select="$xmlData/data/proposal/sub_grant_code" />
</c:set>


<div class="t_bar"><span class="color_red">*</span>资金信息（单位：万元）</div>
<table class="t_css" width="100%" border="0" cellpadding="0" id="totalfunds"
	cellspacing="1">
	<tr>
		<td width="10%"  align="center">项目总投资</td>
		<td colspan="2"><input type="text" label="项目总投资"
		    class="gray valueEqual:input_total:source_total" disabled
			style="text-align: right; width: 80%" name="budgets/input_total"
			id="input_total"  value="<x:out select="$xmlData/data/budgets/input_total" />"
			onfocus="InitInput.setNumber(this,9,4,2)" /></td>
		<td colspan="2" width="20%"  align="center">其中本企业投资</td>
		<td width="15%"><input type="text" style="text-align: right; width: 100px"
			name="budgets/already_input_total" id="input_already"
			class="required valueGreatEqual:input_already:source_funds " label="其中本企业投资"
			onchange="countFundAuto('input_','already,teamwork','total'); budget();"
			value="<x:out select="$xmlData/data/budgets/already_input_total" />"
			onfocus="InitInput.setNumber(this,9,4,2)" /></td>
		<td width="10%"  align="center">占比（%）</td>
		<td width="15%"><input type="text" style="text-align: right; width: 100px"
			name="budgets/already_input_total_pre" id="input_already_pre"
			class="gray" disabled
		    value="<x:out select="$xmlData/data/budgets/already_input_total_pre" />" /></td>
	</tr>
	<tr >
		<td width="10%" align="center" nowrap>合作单位名称</td>
		<td colspan="2"><input type="text" maxlength="100" style=" width: 80%" name="budgets/teamwork_name" class="required" label="合作单位名称"
			id="teamwork_name"  value="<x:out select="$xmlData/data/budgets/teamwork_name" />" /></td>
		<td colspan="2" align="center" nowrap>合作单位投资</td>
		<td ><input type="text" style="text-align: right; width: 100px"
			name="budgets/teamwork_budget" id="input_teamwork" class="required" label="合作单位投资"
			onchange="countFundAuto('input_','already,teamwork','total'); budget();"
			value="<x:out select="$xmlData/data/budgets/teamwork_budget" />"
			onfocus="InitInput.setNumber(this,9,4,2)" /></td>
		<td width="10%" align="center" nowrap>占比（%）</td>
		<td ><input type="text" style="text-align: right; width: 100px"
			name="budgets/teamwork_budget_pre" id="input_teamwork_pre"
			class="gray" disabled
		    value="<x:out select="$xmlData/data/budgets/teamwork_budget_pre" />" /></td>
	</tr>
	
	<tr>
		<td align="center">资金来源</td>
		<td colspan="2">
		<input type="hidden"
			style="text-align: right; width: 80%" name="budgets/input_total_2"
			id="source_total_2" disabled label="资金来源+申请金额"
			value="<x:out select="$xmlData/data/budgets/input_total_2" />"
			onfocus="InitInput.setNumber(this,9,4,2)" />
		<input type="text" style="text-align: right;width: 80%"
			name="budgets/source_total" id="source_total" class="gray" disabled
			label="资金来源"
			value="<x:out select="$xmlData/data/budgets/source_total" />"
			onfocus="InitInput.setNumber(this,9,4,2)" /></td>
		<td  align="center" colspan="2">申请金额</td>
		<td  colspan="3">
			<input id="source_funds" class="required valueGreatEqual:source_area:source_funds" onchange="countFundAuto('source_','total,funds','total_2');" name="proposal/total_funds" style="text-align:right;width: 100px" onfocus="InitInput.setNumber(this,7,4,2)" label="申请金额" type="text"  class="input_css "   maxlength="20" value="<x:out select="$xmlData/data/proposal/total_funds" />"/> 
		</td>
	</tr>
	<tr align="center">
		<td rowspan="2">自有资金</td>
		<td rowspan="2">银行贷款</td>
		<td colspan="4">已获政府资金</td>
		<td rowspan="2" colspan="2">其他资金</td>
	</tr>
	<tr align="center">
		<td>国家</td>
		<td>省级</td>
		<td>市级</td>
		<td>区级</td>
	</tr>
	<tr align="center">
		<td><input type="text" style="text-align: right; width: 100px"
			name="budgets/own_fund" id="source_own"
			onchange="countFundAuto('source_','own,bank,other,country,provincial,city,area','total');countFundAuto('source_','total,funds','total_2');"
			class="required" label="自有资金"
			value="<x:out select="$xmlData/data/budgets/own_fund" />"
			onfocus="InitInput.setNumber(this,9,4,2)" /></td>

		<td><input type="text" style="text-align: right; width: 100px"
			name="budgets/bank_fund" id="source_bank"
			onchange="countFundAuto('source_','own,bank,other,country,provincial,city,area','total');countFundAuto('source_','total,funds','total_2');"
			class="required" label="银行贷款"
			value="<x:out select="$xmlData/data/budgets/bank_fund" />"
			onfocus="InitInput.setNumber(this,9,4,2)" /></td>

		<td><input type="text" style="text-align: right; width: 100px"
			name="budgets/other_fund" id="source_other" class="required" label="已获政府资金(国家)"
			onchange="countFundAuto('source_','own,bank,other,country,provincial,city,area','total');countFundAuto('source_','total,funds','total_2');"
			
			value="<x:out select="$xmlData/data/budgets/other_fund" />"
			onfocus="InitInput.setNumber(this,9,4,2)" /></td>

		<td><input type="text" style="text-align: right; width: 100px"
			name="budgets/country_fund" id="source_country" class="required" label="已获政府资金(省级)"
			onchange="countFundAuto('source_','own,bank,other,country,provincial,city,area','total');countFundAuto('source_','total,funds','total_2');"
			
			value="<x:out select="$xmlData/data/budgets/country_fund" />"
			onfocus="InitInput.setNumber(this,9,4,2)" /></td>

		<td><input type="text" style="text-align: right; width: 100px"
			name="budgets/provincial_fund" id="source_provincial" class="required" label="已获政府资金(市级)"
			onchange="countFundAuto('source_','own,bank,other,country,provincial,city,area','total');countFundAuto('source_','total,funds','total_2');"
			
			value="<x:out select="$xmlData/data/budgets/provincial_fund" />"
			onfocus="InitInput.setNumber(this,9,4,2)" /></td>

		<td><input type="text" style="text-align: right; width: 100px"
			name="budgets/city_fund" id="source_city" class="required" label="已获政府资金(区级)"
			onchange="countFundAuto('source_','own,bank,other,country,provincial,city,area','total');countFundAuto('source_','total,funds','total_2');"
			
			value="<x:out select="$xmlData/data/budgets/city_fund" />"
			onfocus="InitInput.setNumber(this,9,4,2)" /></td>
		<td colspan="2"><input type="text"
			style="text-align: right; width: 100px" name="budgets/area_fund"
			id="source_area" class="required" label="其他资金"
			onchange="countFundAuto('source_','own,bank,other,country,provincial,city,area','total');countFundAuto('source_','total,funds','total_2');"
			class="" label="其他资金"
			value="<x:out select="$xmlData/data/budgets/area_fund" />"
			onfocus="InitInput.setNumber(this,9,4,2)" /></td>
	
	</tr>

</table>
<script type="text/javascript">
<!--

$(document).ready(function() {
	var prp_version=$("#prp_version").text();

	if(prp_version==""||prp_version==null){
		
		$("#totalfunds").find(":input[type!=hidden]").each(function(){
			$(this).val("0.00");	
			});
	}

		
	});


function budget(){
	
	var budget1=$("#input_already").val();
	var budget2=$("#input_total").val();
	var budget3=$("#input_teamwork").val();
	$("#input_already_pre").val(formatVal(budget1*100/budget2));
	$("#input_teamwork_pre").val(formatVal(budget3*100/budget2));	

	
	
	
}
//-->
</script>



